package com.bookmanager.www.controller.rabbitmq;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: 风离
 * @Date: 2021/10/14/14:59
 * @Description:
 */
@Component
// 持久化 非独占 不是自动删除
@RabbitListener(queuesToDeclare = @Queue("hello-world"))
public class hello {

    @RabbitHandler
    public void receive(String message)
    {
        System.err.println("消费者接受到的消息是："+message);
    }


}
